package com.satan.vote.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.mybatisflex.annotation.Id;
import com.mybatisflex.annotation.KeyType;
import com.mybatisflex.annotation.Table;
import com.satan.vote.serializer.CustomDateTimeDerializer;
import lombok.Data;

import java.time.LocalDateTime;

/**
 * @ClassName WxVote
 * @Description TODO
 * @date 2023/8/13 14:42
 * @Version 1.0
 */
@Data
@Table("tb_vote")
public class Vote {
    @Id(keyType = KeyType.Auto)
    private Integer id; // 编号
    private String title; // 标题
    private String explanation; // 投票说明
    private String coverImage; // 封面图片
    @JsonDeserialize(using = CustomDateTimeDerializer.class)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime voteEndTime; // 投票结束时间
    private String openid; // 投票发起人openid
//    @Column(onInsertValue = "1")
    private Integer type; // 1 文字投票 2 图片投票

}
